//
//  OMOrderEvaluateDetailCommentTableCell.m
//  OMENGO_NEW
//
//  Created by 梁尚嘉 on 2017/5/17.
//  Copyright © 2017年 Kamfat. All rights reserved.
//

#import "OMOrderEvaluateDetailCommentTableCell.h"
#import "NSString+AttributedString.h"
#import "NSAttributedString+SizeRemind.h"
@interface OMOrderEvaluateDetailCommentTableCell ()
@property (nonatomic, strong) UILabel *elementLabel;
@property (nonatomic, strong) UILabel *contentLabel;
@end

@implementation OMOrderEvaluateDetailCommentTableCell

- (void)configure
{
    [super configure];
    _elementLabel = [UILabel new];
    _elementLabel.font = SM_CBFont(31);
    _elementLabel.textColor = SM_blackColor;
    _elementLabel.text = @"评论";
    [self.contentView addSubview:_elementLabel];
    [_elementLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(SM_SIZE(30)));
        make.top.equalTo(@(SM_SIZE(30)));

    }];

    _contentLabel = [UILabel new];
    _contentLabel.font = SM_CFont(30);
    _contentLabel.textColor = SM_darkGrayColor;
    _contentLabel.numberOfLines = 0;
    [self.contentView addSubview:_contentLabel];
    [_contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(SM_SIZE(30)));
        make.top.equalTo(@(SM_SIZE(70)));
        make.right.equalTo(@(SM_SIZE(-30)));
        make.bottom.equalTo(@(SM_SIZE(-30)));
    }];


}

- (void)configureCellWithObj:(id)obj
{
    _contentLabel.text = obj;
}


+ (CGFloat)cellHeightWithObject:(NSString *)obj
{
    NSAttributedString *att = [[NSAttributedString alloc]initWithString:obj attributes:@{NSFontAttributeName:SM_CFont(30)}];
    return [att boundSize:CGSizeMake(SM_SCREEN_WIDTH-SM_SIZE(30)*2, 999)].height+SM_SIZE(90)+ SM_SIZE(30);
}
@end
